﻿using TCommon;

namespace TCommunication.Interface;
/// <summary>
/// Can盒基接口
/// </summary>
public interface ICanBox : IDisposable
{
    /// <summary>
    /// 是否连接
    /// </summary>
    public bool IsConnected { get; }
    /// <summary>
    /// 创建Can通道
    /// </summary>
    /// <param name="channel">通道序号</param>
    /// <returns>创建的<see cref="ICanChannel"/>对象</returns>
    public OperateResult<ICanChannel> CreateChannel(int channel);
    /// <summary>
    /// 连接Can卡
    /// </summary>
    /// <returns></returns>
    public OperateResult Connect();
    /// <summary>
    /// 断开连接
    /// </summary>
    /// <returns></returns>
    public OperateResult DisConnect();
}